#!/bin/bash -e
set -o pipefail
rm -rf  /tmp/chinadns-ng
mkdir /tmp/chinadns-ng
wget https://raw.githubusercontent.com/pexcn/daily/gh-pages/chnroute/chnroute.txt -nv -O /tmp/chinadns-ng/chnroute.txt
wget https://raw.githubusercontent.com/pexcn/daily/gh-pages/chnroute/chnroute-v6.txt -nv -O /tmp/chinadns-ng/chnroute6.txt
wget https://raw.githubusercontent.com/pexcn/daily/gh-pages/gfwlist/gfwlist.txt -nv -O /tmp/chinadns-ng/gfwlist.txt
wget https://raw.githubusercontent.com/pexcn/daily/gh-pages/chinalist/chinalist.txt -nv -O /tmp/chinadns-ng/chinalist.txt
find /tmp/chinadns-ng/ -size -20k -exec rm {} \;
chmod -R  755  /tmp/chinadns-ng
cp -rf /tmp/chinadns-ng/** /etc/chinadns-ng
#wget -P /tmp "https://raw.githubusercontent.com/QiuSimons/Others/master/blacklist-ip.conf" && cat /tmp/blacklist-ip.conf >> "/etc/smartdns/blacklist-ip.conf" && cat "/etc/smartdns/blacklist-ip.conf" | sort | uniq > /tmp/tmp_blacklist-ip.conf && cat /tmp/tmp_blacklist-ip.conf > "/etc/smartdns/blacklist-ip.conf"
exit 0
